﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Fcdbas.Platform.Design
{
    public class DropDownListConverter : StringConverter
    {
        private string[] m_Objects = {"Uppercase","Lowercase","Currency","Percentage","Decimal","Integer","Date","DateTime","Time","Unformatted"};
        //public DropDownListConverter(string[] objects)
        //{
        //    m_Objects = objects;
        //}
        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
        {
            return true;
        }
        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)  
        {  
            return true;
        }
        public override
        System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            return new StandardValuesCollection(m_Objects);//我们可以直接在内部定义一个数组，但并不建议这样做，这样对于下拉框的灵活             //性有很大影响  
        }  
    }
}
